*============================================================*
set more off
*============================================================*

*=============================================================================*
*=== Table 7 =================================================================*
*=============================================================================*

use Table7.dta,replace

svyset PSU [pw=wgh]




*=== Farmer ===*
preserve
keep if seclass <= 13 

svy : reg income treatChan /*
*/  SEC01 SEC02 SEC03 SEC04 SEC05 SEC06 SEC11 SEC12 SEC13 SEC21 SEC32 SEC41 SEC50 SEC60 SEC71  /*
*/  Age0_5 AgeM6_11 AgeF6_11 AgeM12_17 AgeF12_17 AgeM18_Att AgeF18_Att AgeM18_64no AgeF18_64no AgeM18_64Pri AgeF18_64Pri AgeM18_64Sec AgeF18_64Sec AgeM18_64PSec AgeF18_64PSec AgeM65_ AgeF65_  /*
*/  Rain1 Rain2 Rain3 Rain4 Rain5 Rain6 Rain7 Rain8 Rain9 Rain10 Rain11 Rain12 /*
*/  Rain1_2 Rain2_2 Rain3_2 Rain4_2 Rain5_2 Rain6_2 Rain7_2 Rain8_2 Rain9_2 Rain10_2 Rain11_2 Rain12_2 /*
*/  i.month /*
*/  chan11 chan12 chan13 chan14 chan15 chan16 chan17 chan18 chan19 chan20 chan21 chan22 chan23 chan24 chan25 chan26 chan27 /*
*/  chan30 chan31 chan32 chan33 chan34 chan35 chan36 chan37 chan39 chan40 chan41 chan42 chan43 chan44 chan45 chan46 chan47 chan48 chan49 /*
*/  chan50 chan51 chan52 chan53 chan54 chan55 chan56 chan57 chan58 chan60 chan61 chan62 chan63 chan64 chan65 chan66 chan67 /* 
*/  chan70 chan71 chan72 chan73 chan74 chan75 chan76 chan77 chan80 chan81 chan82 chan83 chan84 chan85 chan86 chan90 chan91 chan92 chan93 chan94 chan95 chan96  


gen permanentry_wgh = _b[treatChan]*treatChan + /*
*/ _b[SEC01]*SEC01 + _b[SEC02]*SEC02 + _b[SEC03]*SEC03 + _b[SEC04]*SEC04 + _b[SEC05]*SEC05 + _b[SEC06]*SEC06 + /*
*/ _b[SEC11]*SEC11 + _b[SEC12]*SEC12 + _b[SEC13]*SEC13 + _b[SEC21]*SEC21 + _b[SEC32]*SEC32 + /*
*/ _b[SEC41]*SEC41 + _b[SEC50]*SEC50 + _b[SEC60]*SEC60 + _b[SEC71]*SEC71 + /*         
*/ _b[Age0_5]*Age0_5 + _b[AgeM6_11]*AgeM6_11 + _b[AgeF6_11]*AgeF6_11 + _b[AgeM12_17]*AgeM12_17 + _b[AgeF12_17]*AgeF12_17 + _b[AgeM18_Att]*AgeM18_Att + _b[AgeF18_Att]*AgeF18_Att +  /*                                    
*/ _b[AgeM18_64no]*AgeM18_64no + _b[AgeF18_64no]*AgeF18_64no + _b[AgeM18_64Pri]*AgeM18_64Pri + _b[AgeF18_64Pri]*AgeF18_64Pri + _b[AgeM18_64Sec]*AgeM18_64Sec + _b[AgeF18_64Sec]*AgeF18_64Sec +  /* 
*/ _b[AgeM18_64PSec]*AgeM18_64PSec + _b[AgeF18_64PSec]*AgeF18_64PSec + _b[AgeM65_]*AgeM65_ + _b[AgeF65_]*AgeF65_ + /*
*/ _b[chan11]*chan11 + _b[chan12]*chan12 + _b[chan13]*chan13 + _b[chan14]*chan14 + _b[chan15]*chan15 + _b[chan16]*chan16 + _b[chan17]*chan17 + _b[chan18]*chan18 +  /*
*/ _b[chan19]*chan19 + _b[chan20]*chan20 + _b[chan21]*chan21 + _b[chan22]*chan22 + _b[chan23]*chan23 + _b[chan24]*chan24 + _b[chan25]*chan25 + _b[chan26]*chan26 +  /*
*/ _b[chan27]*chan27 + _b[chan30]*chan30 + _b[chan31]*chan31 + _b[chan32]*chan32 + _b[chan33]*chan33 + _b[chan34]*chan34 + _b[chan35]*chan35 + _b[chan36]*chan36 +  /*
*/ _b[chan37]*chan37 + _b[chan39]*chan39 + _b[chan40]*chan40 + _b[chan41]*chan41 + _b[chan42]*chan42 + _b[chan43]*chan43 + _b[chan44]*chan44 + _b[chan45]*chan45 +  /*
*/ _b[chan46]*chan46 + _b[chan47]*chan47 + _b[chan48]*chan48 + _b[chan49]*chan49 + _b[chan50]*chan50 + _b[chan51]*chan51 + _b[chan52]*chan52 + _b[chan53]*chan53 +  /*
*/ _b[chan54]*chan54 + _b[chan55]*chan55 + _b[chan56]*chan56 + _b[chan57]*chan57 + _b[chan58]*chan58 + _b[chan60]*chan60 + _b[chan61]*chan61 + _b[chan62]*chan62 +  /*
*/ _b[chan63]*chan63 + _b[chan64]*chan64 + _b[chan65]*chan65 + _b[chan66]*chan66 + _b[chan67]*chan67 + _b[chan70]*chan70 + _b[chan71]*chan71 + _b[chan72]*chan72 +  /*
*/ _b[chan73]*chan73 + _b[chan74]*chan74 + _b[chan75]*chan75 + _b[chan76]*chan76 + _b[chan77]*chan77 + _b[chan80]*chan80 + _b[chan81]*chan81 + _b[chan82]*chan82 +  /*
*/ _b[chan83]*chan83 + _b[chan84]*chan84 + _b[chan85]*chan85 + _b[chan86]*chan86 + _b[chan90]*chan90 + _b[chan91]*chan91 + _b[chan92]*chan92 + _b[chan93]*chan93 +  /*
*/ _b[chan94]*chan94 + _b[chan95]*chan95 + _b[chan96]*chan96 

 
gen transitry_wgh = _b[Rain1]*Rain1 + _b[Rain2]*Rain2 + _b[Rain3]*Rain3 + _b[Rain4]*Rain4 + _b[Rain5]*Rain5 + _b[Rain6]*Rain6 + _b[Rain7]*Rain7 + _b[Rain8]*Rain8 +  /*
*/ _b[Rain9]*Rain9 + _b[Rain10]*Rain10 + _b[Rain11]*Rain11 + _b[Rain12]*Rain12 + _b[Rain1_2]*Rain1_2 + _b[Rain2_2]*Rain2_2 + _b[Rain3_2]*Rain3_2 + _b[Rain4_2]*Rain4_2 +  /*
*/ _b[Rain5_2]*Rain5_2 + _b[Rain6_2]*Rain6_2 + _b[Rain7_2]*Rain7_2 + _b[Rain8_2]*Rain8_2 + _b[Rain9_2]*Rain9_2 + _b[Rain10_2]*Rain10_2 + _b[Rain11_2]*Rain11_2 + _b[Rain12_2]*Rain12_2

 
gen uncertainry_wgh = income  - permanentry_wgh - transitry_wgh 

svy : reg save_real treatChan /*
*/ permanentry_wgh c.permanentry_wgh#i.After c.permanentry_wgh#i.treatChan c.permanentry_wgh#i.After#i.treatChan /*
*/ transitry_wgh uncertainry_wgh other_income /*
*/ R1sd R2sd R3sd R4sd R5sd R6sd R7sd R8sd R9sd R10sd R11sd R12sd /*
*/ Age0_5 Age6_11 Age12_17 Age18_64 Age65_ /* 
*/ i.month 

restore
*=== Enterpreneurs, trade and indusgtry ===*

preserve
keep if ((seclass >= 21 & seclass <= 22)) 
svyset PSU [pw=wgh]

svy : reg income treatChan /*
*/  SEC01 SEC02 SEC03 SEC04 SEC05 SEC06 SEC11 SEC12 SEC13 SEC21 SEC32 SEC41 SEC50 SEC60 SEC71  /*
*/  Age0_5 AgeM6_11 AgeF6_11 AgeM12_17 AgeF12_17 AgeM18_Att AgeF18_Att AgeM18_64no AgeF18_64no AgeM18_64Pri AgeF18_64Pri AgeM18_64Sec AgeF18_64Sec AgeM18_64PSec AgeF18_64PSec AgeM65_ AgeF65_  /*
*/  Rain1 Rain2 Rain3 Rain4 Rain5 Rain6 Rain7 Rain8 Rain9 Rain10 Rain11 Rain12 /*
*/  Rain1_2 Rain2_2 Rain3_2 Rain4_2 Rain5_2 Rain6_2 Rain7_2 Rain8_2 Rain9_2 Rain10_2 Rain11_2 Rain12_2 /*
*/  i.month /*
*/  chan11 chan12 chan13 chan14 chan15 chan16 chan17 chan18 chan19 chan20 chan21 chan22 chan23 chan24 chan25 chan26 chan27 /*
*/  chan30 chan31 chan32 chan33 chan34 chan35 chan36 chan37 chan39 chan40 chan41 chan42 chan43 chan44 chan45 chan46 chan47 chan48 chan49 /*
*/  chan50 chan51 chan52 chan53 chan54 chan55 chan56 chan57 chan58 chan60 chan61 chan62 chan63 chan64 chan65 chan66 chan67 /* 
*/  chan70 chan71 chan72 chan73 chan74 chan75 chan76 chan77 chan80 chan81 chan82 chan83 chan84 chan85 chan86 chan90 chan91 chan92 chan93 chan94 chan95 chan96  

gen permanentry_wgh = _b[treatChan]*treatChan + /*
*/ _b[SEC01]*SEC01 + _b[SEC02]*SEC02 + _b[SEC03]*SEC03 + _b[SEC04]*SEC04 + _b[SEC05]*SEC05 + _b[SEC06]*SEC06 + /*
*/ _b[SEC11]*SEC11 + _b[SEC12]*SEC12 + _b[SEC13]*SEC13 + _b[SEC21]*SEC21 + _b[SEC32]*SEC32 + /*
*/ _b[SEC41]*SEC41 + _b[SEC50]*SEC50 + _b[SEC60]*SEC60 + _b[SEC71]*SEC71 + /*         
*/ _b[Age0_5]*Age0_5 + _b[AgeM6_11]*AgeM6_11 + _b[AgeF6_11]*AgeF6_11 + _b[AgeM12_17]*AgeM12_17 + _b[AgeF12_17]*AgeF12_17 + _b[AgeM18_Att]*AgeM18_Att + _b[AgeF18_Att]*AgeF18_Att +  /*                                    
*/ _b[AgeM18_64no]*AgeM18_64no + _b[AgeF18_64no]*AgeF18_64no + _b[AgeM18_64Pri]*AgeM18_64Pri + _b[AgeF18_64Pri]*AgeF18_64Pri + _b[AgeM18_64Sec]*AgeM18_64Sec + _b[AgeF18_64Sec]*AgeF18_64Sec +  /* 
*/ _b[AgeM18_64PSec]*AgeM18_64PSec + _b[AgeF18_64PSec]*AgeF18_64PSec + _b[AgeM65_]*AgeM65_ + _b[AgeF65_]*AgeF65_ + /*
*/ _b[chan11]*chan11 + _b[chan12]*chan12 + _b[chan13]*chan13 + _b[chan14]*chan14 + _b[chan15]*chan15 + _b[chan16]*chan16 + _b[chan17]*chan17 + _b[chan18]*chan18 +  /*
*/ _b[chan19]*chan19 + _b[chan20]*chan20 + _b[chan21]*chan21 + _b[chan22]*chan22 + _b[chan23]*chan23 + _b[chan24]*chan24 + _b[chan25]*chan25 + _b[chan26]*chan26 +  /*
*/ _b[chan27]*chan27 + _b[chan30]*chan30 + _b[chan31]*chan31 + _b[chan32]*chan32 + _b[chan33]*chan33 + _b[chan34]*chan34 + _b[chan35]*chan35 + _b[chan36]*chan36 +  /*
*/ _b[chan37]*chan37 + _b[chan39]*chan39 + _b[chan40]*chan40 + _b[chan41]*chan41 + _b[chan42]*chan42 + _b[chan43]*chan43 + _b[chan44]*chan44 + _b[chan45]*chan45 +  /*
*/ _b[chan46]*chan46 + _b[chan47]*chan47 + _b[chan48]*chan48 + _b[chan49]*chan49 + _b[chan50]*chan50 + _b[chan51]*chan51 + _b[chan52]*chan52 + _b[chan53]*chan53 +  /*
*/ _b[chan54]*chan54 + _b[chan55]*chan55 + _b[chan56]*chan56 + _b[chan57]*chan57 + _b[chan58]*chan58 + _b[chan60]*chan60 + _b[chan61]*chan61 + _b[chan62]*chan62 +  /*
*/ _b[chan63]*chan63 + _b[chan64]*chan64 + _b[chan65]*chan65 + _b[chan66]*chan66 + _b[chan67]*chan67 + _b[chan70]*chan70 + _b[chan71]*chan71 + _b[chan72]*chan72 +  /*
*/ _b[chan73]*chan73 + _b[chan74]*chan74 + _b[chan75]*chan75 + _b[chan76]*chan76 + _b[chan77]*chan77 + _b[chan80]*chan80 + _b[chan81]*chan81 + _b[chan82]*chan82 +  /*
*/ _b[chan83]*chan83 + _b[chan84]*chan84 + _b[chan85]*chan85 + _b[chan86]*chan86 + _b[chan90]*chan90 + _b[chan91]*chan91 + _b[chan92]*chan92 + _b[chan93]*chan93 +  /*
*/ _b[chan94]*chan94 + _b[chan95]*chan95 + _b[chan96]*chan96 

 
gen transitry_wgh = _b[Rain1]*Rain1 + _b[Rain2]*Rain2 + _b[Rain3]*Rain3 + _b[Rain4]*Rain4 + _b[Rain5]*Rain5 + _b[Rain6]*Rain6 + _b[Rain7]*Rain7 + _b[Rain8]*Rain8 +  /*
*/ _b[Rain9]*Rain9 + _b[Rain10]*Rain10 + _b[Rain11]*Rain11 + _b[Rain12]*Rain12 + _b[Rain1_2]*Rain1_2 + _b[Rain2_2]*Rain2_2 + _b[Rain3_2]*Rain3_2 + _b[Rain4_2]*Rain4_2 +  /*
*/ _b[Rain5_2]*Rain5_2 + _b[Rain6_2]*Rain6_2 + _b[Rain7_2]*Rain7_2 + _b[Rain8_2]*Rain8_2 + _b[Rain9_2]*Rain9_2 + _b[Rain10_2]*Rain10_2 + _b[Rain11_2]*Rain11_2 + _b[Rain12_2]*Rain12_2

 
gen uncertainry_wgh = income  - permanentry_wgh - transitry_wgh 


svy : reg save_real treatChan /*
*/ permanentry_wgh c.permanentry_wgh#i.After c.permanentry_wgh#i.treatChan c.permanentry_wgh#i.After#i.treatChan /*
*/ transitry_wgh uncertainry_wgh other_income /*
*/ R1sd R2sd R3sd R4sd R5sd R6sd R7sd R8sd R9sd R10sd R11sd R12sd /*
*/ Age0_5 Age6_11 Age12_17 Age18_64 Age65_ /* 
*/ i.month 

restore
*=== Other work status ===*

preserve
keep if (seclass >= 50 & seclass <= 60) | (seclass == 32) | (seclass == 41)
svyset PSU [pw=wgh]

svy : reg income treatChan /*
*/  SEC01 SEC02 SEC03 SEC04 SEC05 SEC06 SEC11 SEC12 SEC13 SEC21 SEC32 SEC41 SEC50 SEC60 SEC71  /*
*/  Age0_5 AgeM6_11 AgeF6_11 AgeM12_17 AgeF12_17 AgeM18_Att AgeF18_Att AgeM18_64no AgeF18_64no AgeM18_64Pri AgeF18_64Pri AgeM18_64Sec AgeF18_64Sec AgeM18_64PSec AgeF18_64PSec AgeM65_ AgeF65_  /*
*/  Rain1 Rain2 Rain3 Rain4 Rain5 Rain6 Rain7 Rain8 Rain9 Rain10 Rain11 Rain12 /*
*/  Rain1_2 Rain2_2 Rain3_2 Rain4_2 Rain5_2 Rain6_2 Rain7_2 Rain8_2 Rain9_2 Rain10_2 Rain11_2 Rain12_2 /*
*/  i.month /*
*/  chan11 chan12 chan13 chan14 chan15 chan16 chan17 chan18 chan19 chan20 chan21 chan22 chan23 chan24 chan25 chan26 chan27 /*
*/  chan30 chan31 chan32 chan33 chan34 chan35 chan36 chan37 chan39 chan40 chan41 chan42 chan43 chan44 chan45 chan46 chan47 chan48 chan49 /*
*/  chan50 chan51 chan52 chan53 chan54 chan55 chan56 chan57 chan58 chan60 chan61 chan62 chan63 chan64 chan65 chan66 chan67 /* 
*/  chan70 chan71 chan72 chan73 chan74 chan75 chan76 chan77 chan80 chan81 chan82 chan83 chan84 chan85 chan86 chan90 chan91 chan92 chan93 chan94 chan95 chan96 

gen permanentry_wgh = _b[treatChan]*treatChan + /*
*/ _b[SEC01]*SEC01 + _b[SEC02]*SEC02 + _b[SEC03]*SEC03 + _b[SEC04]*SEC04 + _b[SEC05]*SEC05 + _b[SEC06]*SEC06 + /*
*/ _b[SEC11]*SEC11 + _b[SEC12]*SEC12 + _b[SEC13]*SEC13 + _b[SEC21]*SEC21 + _b[SEC32]*SEC32 + /*
*/ _b[SEC41]*SEC41 + _b[SEC50]*SEC50 + _b[SEC60]*SEC60 + _b[SEC71]*SEC71 + /*         
*/ _b[Age0_5]*Age0_5 + _b[AgeM6_11]*AgeM6_11 + _b[AgeF6_11]*AgeF6_11 + _b[AgeM12_17]*AgeM12_17 + _b[AgeF12_17]*AgeF12_17 + _b[AgeM18_Att]*AgeM18_Att + _b[AgeF18_Att]*AgeF18_Att +  /*                                    
*/ _b[AgeM18_64no]*AgeM18_64no + _b[AgeF18_64no]*AgeF18_64no + _b[AgeM18_64Pri]*AgeM18_64Pri + _b[AgeF18_64Pri]*AgeF18_64Pri + _b[AgeM18_64Sec]*AgeM18_64Sec + _b[AgeF18_64Sec]*AgeF18_64Sec +  /* 
*/ _b[AgeM18_64PSec]*AgeM18_64PSec + _b[AgeF18_64PSec]*AgeF18_64PSec + _b[AgeM65_]*AgeM65_ + _b[AgeF65_]*AgeF65_ + /*
*/ _b[chan11]*chan11 + _b[chan12]*chan12 + _b[chan13]*chan13 + _b[chan14]*chan14 + _b[chan15]*chan15 + _b[chan16]*chan16 + _b[chan17]*chan17 + _b[chan18]*chan18 +  /*
*/ _b[chan19]*chan19 + _b[chan20]*chan20 + _b[chan21]*chan21 + _b[chan22]*chan22 + _b[chan23]*chan23 + _b[chan24]*chan24 + _b[chan25]*chan25 + _b[chan26]*chan26 +  /*
*/ _b[chan27]*chan27 + _b[chan30]*chan30 + _b[chan31]*chan31 + _b[chan32]*chan32 + _b[chan33]*chan33 + _b[chan34]*chan34 + _b[chan35]*chan35 + _b[chan36]*chan36 +  /*
*/ _b[chan37]*chan37 + _b[chan39]*chan39 + _b[chan40]*chan40 + _b[chan41]*chan41 + _b[chan42]*chan42 + _b[chan43]*chan43 + _b[chan44]*chan44 + _b[chan45]*chan45 +  /*
*/ _b[chan46]*chan46 + _b[chan47]*chan47 + _b[chan48]*chan48 + _b[chan49]*chan49 + _b[chan50]*chan50 + _b[chan51]*chan51 + _b[chan52]*chan52 + _b[chan53]*chan53 +  /*
*/ _b[chan54]*chan54 + _b[chan55]*chan55 + _b[chan56]*chan56 + _b[chan57]*chan57 + _b[chan58]*chan58 + _b[chan60]*chan60 + _b[chan61]*chan61 + _b[chan62]*chan62 +  /*
*/ _b[chan63]*chan63 + _b[chan64]*chan64 + _b[chan65]*chan65 + _b[chan66]*chan66 + _b[chan67]*chan67 + _b[chan70]*chan70 + _b[chan71]*chan71 + _b[chan72]*chan72 +  /*
*/ _b[chan73]*chan73 + _b[chan74]*chan74 + _b[chan75]*chan75 + _b[chan76]*chan76 + _b[chan77]*chan77 + _b[chan80]*chan80 + _b[chan81]*chan81 + _b[chan82]*chan82 +  /*
*/ _b[chan83]*chan83 + _b[chan84]*chan84 + _b[chan85]*chan85 + _b[chan86]*chan86 + _b[chan90]*chan90 + _b[chan91]*chan91 + _b[chan92]*chan92 + _b[chan93]*chan93 +  /*
*/ _b[chan94]*chan94 + _b[chan95]*chan95 + _b[chan96]*chan96 

gen transitry_wgh = _b[Rain1]*Rain1 + _b[Rain2]*Rain2 + _b[Rain3]*Rain3 + _b[Rain4]*Rain4 + _b[Rain5]*Rain5 + _b[Rain6]*Rain6 + _b[Rain7]*Rain7 + _b[Rain8]*Rain8 +  /*
*/ _b[Rain9]*Rain9 + _b[Rain10]*Rain10 + _b[Rain11]*Rain11 + _b[Rain12]*Rain12 + _b[Rain1_2]*Rain1_2 + _b[Rain2_2]*Rain2_2 + _b[Rain3_2]*Rain3_2 + _b[Rain4_2]*Rain4_2 +  /*
*/ _b[Rain5_2]*Rain5_2 + _b[Rain6_2]*Rain6_2 + _b[Rain7_2]*Rain7_2 + _b[Rain8_2]*Rain8_2 + _b[Rain9_2]*Rain9_2 + _b[Rain10_2]*Rain10_2 + _b[Rain11_2]*Rain11_2 + _b[Rain12_2]*Rain12_2

gen uncertainry_wgh = income  - permanentry_wgh - transitry_wgh 

svy : reg save_real treatChan /*
*/ permanentry_wgh c.permanentry_wgh#i.After c.permanentry_wgh#i.treatChan c.permanentry_wgh#i.After#i.treatChan /*
*/ transitry_wgh uncertainry_wgh other_income /*
*/ R1sd R2sd R3sd R4sd R5sd R6sd R7sd R8sd R9sd R10sd R11sd R12sd /*
*/ Age0_5 Age6_11 Age12_17 Age18_64 Age65_ /* 
*/ i.month 

restore
*=== Economically inactive households ===*

preserve
keep if (seclass == 71) 
svyset PSU [pw=wgh]

svy : reg income treatChan /*
*/  SEC01 SEC02 SEC03 SEC04 SEC05 SEC06 SEC11 SEC12 SEC13 SEC21 SEC32 SEC41 SEC50 SEC60 SEC71  /*
*/  Age0_5 AgeM6_11 AgeF6_11 AgeM12_17 AgeF12_17 AgeM18_Att AgeF18_Att AgeM18_64no AgeF18_64no AgeM18_64Pri AgeF18_64Pri AgeM18_64Sec AgeF18_64Sec AgeM18_64PSec AgeF18_64PSec AgeM65_ AgeF65_  /*
*/  Rain1 Rain2 Rain3 Rain4 Rain5 Rain6 Rain7 Rain8 Rain9 Rain10 Rain11 Rain12 /*
*/  Rain1_2 Rain2_2 Rain3_2 Rain4_2 Rain5_2 Rain6_2 Rain7_2 Rain8_2 Rain9_2 Rain10_2 Rain11_2 Rain12_2 /*
*/  i.month /*
*/  chan11 chan12 chan13 chan14 chan15 chan16 chan17 chan18 chan19 chan20 chan21 chan22 chan23 chan24 chan25 chan26 chan27 /*
*/  chan30 chan31 chan32 chan33 chan34 chan35 chan36 chan37 chan39 chan40 chan41 chan42 chan43 chan44 chan45 chan46 chan47 chan48 chan49 /*
*/  chan50 chan51 chan52 chan53 chan54 chan55 chan56 chan57 chan58 chan60 chan61 chan62 chan63 chan64 chan65 chan66 chan67 /* 
*/  chan70 chan71 chan72 chan73 chan74 chan75 chan76 chan77 chan80 chan81 chan82 chan83 chan84 chan85 chan86 chan90 chan91 chan92 chan93 chan94 chan95 chan96  

gen permanentry_wgh = _b[treatChan]*treatChan + /*
*/ _b[SEC01]*SEC01 + _b[SEC02]*SEC02 + _b[SEC03]*SEC03 + _b[SEC04]*SEC04 + _b[SEC05]*SEC05 + _b[SEC06]*SEC06 + /*
*/ _b[SEC11]*SEC11 + _b[SEC12]*SEC12 + _b[SEC13]*SEC13 + _b[SEC21]*SEC21 + _b[SEC32]*SEC32 + /*
*/ _b[SEC41]*SEC41 + _b[SEC50]*SEC50 + _b[SEC60]*SEC60 + _b[SEC71]*SEC71 + /*         
*/ _b[Age0_5]*Age0_5 + _b[AgeM6_11]*AgeM6_11 + _b[AgeF6_11]*AgeF6_11 + _b[AgeM12_17]*AgeM12_17 + _b[AgeF12_17]*AgeF12_17 + _b[AgeM18_Att]*AgeM18_Att + _b[AgeF18_Att]*AgeF18_Att +  /*                                    
*/ _b[AgeM18_64no]*AgeM18_64no + _b[AgeF18_64no]*AgeF18_64no + _b[AgeM18_64Pri]*AgeM18_64Pri + _b[AgeF18_64Pri]*AgeF18_64Pri + _b[AgeM18_64Sec]*AgeM18_64Sec + _b[AgeF18_64Sec]*AgeF18_64Sec +  /* 
*/ _b[AgeM18_64PSec]*AgeM18_64PSec + _b[AgeF18_64PSec]*AgeF18_64PSec + _b[AgeM65_]*AgeM65_ + _b[AgeF65_]*AgeF65_ + /*
*/ _b[chan11]*chan11 + _b[chan12]*chan12 + _b[chan13]*chan13 + _b[chan14]*chan14 + _b[chan15]*chan15 + _b[chan16]*chan16 + _b[chan17]*chan17 + _b[chan18]*chan18 +  /*
*/ _b[chan19]*chan19 + _b[chan20]*chan20 + _b[chan21]*chan21 + _b[chan22]*chan22 + _b[chan23]*chan23 + _b[chan24]*chan24 + _b[chan25]*chan25 + _b[chan26]*chan26 +  /*
*/ _b[chan27]*chan27 + _b[chan30]*chan30 + _b[chan31]*chan31 + _b[chan32]*chan32 + _b[chan33]*chan33 + _b[chan34]*chan34 + _b[chan35]*chan35 + _b[chan36]*chan36 +  /*
*/ _b[chan37]*chan37 + _b[chan39]*chan39 + _b[chan40]*chan40 + _b[chan41]*chan41 + _b[chan42]*chan42 + _b[chan43]*chan43 + _b[chan44]*chan44 + _b[chan45]*chan45 +  /*
*/ _b[chan46]*chan46 + _b[chan47]*chan47 + _b[chan48]*chan48 + _b[chan49]*chan49 + _b[chan50]*chan50 + _b[chan51]*chan51 + _b[chan52]*chan52 + _b[chan53]*chan53 +  /*
*/ _b[chan54]*chan54 + _b[chan55]*chan55 + _b[chan56]*chan56 + _b[chan57]*chan57 + _b[chan58]*chan58 + _b[chan60]*chan60 + _b[chan61]*chan61 + _b[chan62]*chan62 +  /*
*/ _b[chan63]*chan63 + _b[chan64]*chan64 + _b[chan65]*chan65 + _b[chan66]*chan66 + _b[chan67]*chan67 + _b[chan70]*chan70 + _b[chan71]*chan71 + _b[chan72]*chan72 +  /*
*/ _b[chan73]*chan73 + _b[chan74]*chan74 + _b[chan75]*chan75 + _b[chan76]*chan76 + _b[chan77]*chan77 + _b[chan80]*chan80 + _b[chan81]*chan81 + _b[chan82]*chan82 +  /*
*/ _b[chan83]*chan83 + _b[chan84]*chan84 + _b[chan85]*chan85 + _b[chan86]*chan86 + _b[chan90]*chan90 + _b[chan91]*chan91 + _b[chan92]*chan92 + _b[chan93]*chan93 +  /*
*/ _b[chan94]*chan94 + _b[chan95]*chan95 + _b[chan96]*chan96 

gen transitry_wgh = _b[Rain1]*Rain1 + _b[Rain2]*Rain2 + _b[Rain3]*Rain3 + _b[Rain4]*Rain4 + _b[Rain5]*Rain5 + _b[Rain6]*Rain6 + _b[Rain7]*Rain7 + _b[Rain8]*Rain8 +  /*
*/ _b[Rain9]*Rain9 + _b[Rain10]*Rain10 + _b[Rain11]*Rain11 + _b[Rain12]*Rain12 + _b[Rain1_2]*Rain1_2 + _b[Rain2_2]*Rain2_2 + _b[Rain3_2]*Rain3_2 + _b[Rain4_2]*Rain4_2 +  /*
*/ _b[Rain5_2]*Rain5_2 + _b[Rain6_2]*Rain6_2 + _b[Rain7_2]*Rain7_2 + _b[Rain8_2]*Rain8_2 + _b[Rain9_2]*Rain9_2 + _b[Rain10_2]*Rain10_2 + _b[Rain11_2]*Rain11_2 + _b[Rain12_2]*Rain12_2

gen uncertainry_wgh = income  - permanentry_wgh - transitry_wgh 

svy : reg save_real treatChan /*
*/ permanentry_wgh c.permanentry_wgh#i.After c.permanentry_wgh#i.treatChan c.permanentry_wgh#i.After#i.treatChan /*
*/ transitry_wgh uncertainry_wgh other_income /*
*/ R1sd R2sd R3sd R4sd R5sd R6sd R7sd R8sd R9sd R10sd R11sd R12sd /*
*/ Age0_5 Age6_11 Age12_17 Age18_64 Age65_ /* 
*/ i.month  




